import React, { Component } from 'react';
import { View, Text, Image, TouchableHighlight } from 'react-native';
import { Button } from "native-base"

export default class HomeTwoCell extends Component {
    constructor(props) {
        super(props);
        this.state = {
        };
    }

    addShopBtnClick = (e) => {
        console.warn("======================")
    }

    render() {
        return (
            <TouchableHighlight underlayColor={"rgba(0,0,0,0)"} onPress={() => { alert(this.props.dict.id) }} style={{ flex: 1, backgroundColor: "#ffffff", borderRadius: 5, overflow: "hidden" }}>
                <View>

                    <Image
                        source={{ uri: this.props.dict.thumb }}
                        style={{ width: "100%", height: 164 }}
                    />
                    {/* 下面价格和标题 */}
                    <View style={{ flex: 1, padding: 12 }}>
                        <Text numberOfLines={2}>{this.props.dict.title}</Text>
                        <Text numberOfLines={1} style={{ marginTop: 10, color: "#929395", fontSize: 11 }}>{this.props.dict.subtitle}</Text>
                        <View style={{ marginTop: 10, flexDirection: "row", alignItems: "center" }}>
                            <Text>￥</Text>
                            <Text>{this.props.dict.shop_price}</Text>
                        </View>
                        <Button transparent style={{ width: 30, height: 30, position: "absolute", bottom: 10, right: 10 }}
                            onPress={this.addShopBtnClick}
                        >
                            <Image
                                style={{ width: 30, height: 30 }}
                                source={{ uri: "https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng3fa309976e14fa5195e6790777303eaa933d187c87ddf023cd5d3aa0bc24dac7" }}></Image>
                        </Button>
                    </View>
                </View>
            </TouchableHighlight>
        );
    }
}
